<?php


namespace app\api\behavior\course;


use app\api\service\CourseRemindService;

class AutoFinish
{
    public function run($model)
    {
        //完成课程
        $this->finish();
        return true;
    }

    /**
     * 自动完成课程
     */
    public function finish()
    {
        $remindTime = config('setting.course')['finish_time'];
        if (!$remindTime) {
            return false;
        }
        CourseRemindService::remind($remindTime, 2, 1);
        return true;
    }
}